{extend name="base" /}
{block name="body"}
<div class="layui-card">
    <div class="layui-card-body">
        <div class="layui-btn-group">
            <a href="{:url('user/config/add')}" class="layui-btn"><i class="fa fa-plus-circle"></i> 添加配置</a>
        </div>
        <table class="layui-table layui-form">
            <thead>
            <tr>
                <th>ID</th>
                <th>配置分组</th>
                <th>配置标题</th>
                <th>配置标识</th>
                <th>配置类型</th>
                <th>排序</th>
                <th>状态</th>
                <th width="120">操作</th>
            </tr>
            </thead>
            <tbody>
            {foreach name="list" item="v"}
            <tr>
                <td>{$v.id}</td>
                <td>{:config('customer')[$v.group]}[{$v.group}]</td>
                <td>{$v.title}</td>
                <td>{$v.name}</td>
                <td>{:config('configType')[$v.type]}[{$v.type}]</td>
                <td>
                    <input type="text" name="sort_order" value="{$v.sort_order}" autocomplete="off" class="layui-input ajax-update" data-url="{:url('user/config/edit', ['id' => $v.id])}">
                </td>
                <td>
                    {if $v.is_sys<>'1'}
                    <input type="checkbox" name="status" lay-skin="switch" lay-filter="*" lay-text="启用|禁用" data-url="{:url('user/config/edit', ['id' => $v.id])}" {if $v.status eq 1}checked="checked"{/if}>
                    {/if}
                </td>
                <td>
                    <a href="{:url('user/config/edit', ['id' => $v.id])}" class="layui-btn layui-btn-xs layui-btn-normal"><i class="fa fa-edit"></i> 编辑</a>
                    <a href="{:url('user/config/del', ['id' => $v.id])}" class="layui-btn layui-btn-xs layui-btn-danger ajax-delete"><i class="fa fa-trash-o"></i> 删除</a>
                </td>
            </tr>
            {/foreach}
            </tbody>
        </table>
        <div class="page">{$list->render()}</div>
    </div>
</div>
{/block}
